import { createApp } from "vue"
import App from "./App.vue"
import "normalize.css"
import "@/assets/css/index.css"

import ElementPlus from "element-plus"
import zhCn from "element-plus/dist/locale/zh-cn.mjs"
import "element-plus/dist/index.css"
import { globalRegister } from "@/global/index"

// 引入组件图标
import * as ElementPlusIconsVue from "@element-plus/icons-vue"

import router from "./router"
import store from "./store"

// 处理登录之后进入页面获取本地的数据储存到 vuex
import { setupStore } from "./store"

const Vue = createApp(App)
Vue.use(ElementPlus, { locale: zhCn })
setupStore()
Vue.use(router)
Vue.use(store)
Vue.use(globalRegister)
Vue.mount("#app")

// 使用组件图标
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
  Vue.component(key, component)
}
